import request from '@/utils/request'

// 查询借用用户信息
export function queryUser(nickName){
  return request({
    url: '/device/deviceBorrow/queryUser/' +nickName,
    method: 'get',
  })
}
// 查询借用设备信息
export function queryDevice(deviceName){
  return request({
    url: '/device/deviceBorrow/queryDevice/' +deviceName,
    method: 'get',
  })
}
// 查询设备借用列表
export function listDeviceBorrow(query) {
  return request({
    url: '/device/deviceBorrow/list',
    method: 'get',
    params: query
  })
}

// 查询设备借用详细
export function getDeviceBorrow(borrowId) {
  return request({
    url: '/device/deviceBorrow/' + borrowId,
    method: 'get'
  })
}

// 新增设备借用
export function addDeviceBorrow(data) {
  return request({
    url: '/device/deviceBorrow',
    method: 'post',
    data: data
  })
}

// 修改设备借用
export function updateDeviceBorrow(data) {
  return request({
    url: '/device/deviceBorrow',
    method: 'put',
    data: data
  })
}

// 删除设备借用
export function delDeviceBorrow(borrowId) {
  return request({
    url: '/device/deviceBorrow/' + borrowId,
    method: 'delete'
  })
}
